<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

?>
    <div id="find">
        <form action='<?php echo '/' . $db->path . 'products/search' ; ?>' method="POST" class="findform">
            <input type="text" size="100" name="search" value="search" onfocus="if (this.value == this.defaultValue){this.value = '';}" />
            <input type="submit" value="find" />
        </form>
    </div>
    <div id="login">
        
        <?php if(isset ($_COOKIE['ID'])) 
              { 
                if(!isset ($_SESSION['cart']['count'])) $_SESSION['cart']['count'] = 0 ;
                echo 'Ви, <b>' . $_COOKIE['name'] . '</b>!' ;
                echo '<div class="cart">
                    <a href="/' . $db->path . 'cart"><img src="/' . $db->path . 'public/imgpage/shopping_basket.png"></a>
                    <b>[' . $_SESSION['cart']['count'] . ']</b>
                        </div>' ;
                echo '<form action="/' . $db->path . '" method="POST" class="loginform">
                        <input type="submit" name="out" value="Вихід">
                      </form>' ;
            
              } else {
        ?> 
        <form action="/<?php echo $db->path ; ?>user/register" method="POST" class="loginform">
            <input type="submit" name="reg" value="Реєстрація" class="reg">
        </form>
        <form action="/<?php echo $db->path ?>" method="POST" class="loginform">	
            <input type="text" size="50" name="login" value="login" onfocus="if (this.value == this.defaultValue){this.value = '';}" />
            <input type="password" size="50" name="pass" value="pass" onfocus="if (this.value == this.defaultValue){this.value = '';}"/>
            <input type="submit" value="Вхід" name="in"/>
        </form>
        <?php } ?>
       
    </div>